$(function(){
		var pathName = document.location.pathname;
		var index = pathName.substr(1).indexOf("/");
		var result = pathName.substr(0,index+1);
		var url = decodeURI(location.search);
		var id = url.substr(6);
		$.ajax({
			url:result+"/pro/view",
			data:"epId="+id,
			dataType:"json",
			type:"get",
			success:function(data){
				if(data.success){
					proRender(data.data);
					sessionStorage.setItem("epId", data.data.epId);
				}else{
					alert(data.message);
				}
			},
			error:function(){
				alert("获取用户详情信息失败");
			}
		});
		
		function proRender(data){
			var str = "<h1>"+data.epName+"</h1><div class='infos'>"+
			"<div class='thumb'><img src='../../statics/images/product/"+data.epFileName+"' /></div><div class='buy'><p>商城价：<span class='price'>￥"+data.epPrice+"</span></p>"+
			"<p>库　存："+data.epStock+"</p>"+
			"<div class='button'><input type='button' name='button' value='' onclick='goBuy(1)' /><a href='#'>放入购物车</a></div></div><div class='clear'></div>"
			+"<div class='introduce'><h2><strong>商品详情</strong></h2><div class='text'>"+data.epDescription+"<br /></div></div>"
			$(".main").append(str);
		}
		
	})